/*
 * Copyright (C) 2018 The Asiainfo-Ability Authors
 *
 *      Licensed under the Apache License, Version 2.0 (the "License");
 *      you may not use this file except in compliance with the License.
 *      You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *      Unless required by applicable law or agreed to in writing, software
 *      distributed under the License is distributed on an "AS IS" BASIS,
 *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *      See the License for the specific language governing permissions and
 *      limitations under the License.
 */

package org.asiainfo.ability.gateway.model;

/**
 * @Author: visen
 * @Date: 2018/1/28
 * @Description:
 */
public class Machine {
    private String id;
    private String name;
    private String ipAddress;
    private String state = "停止";
    private double cpuRatio;
    private double memRatio;
    private double diskRatio;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public double getCpuRatio() {
        return cpuRatio;
    }

    public void setCpuRatio(double cpuRatio) {
        this.cpuRatio = cpuRatio;
    }

    public double getMemRatio() {
        return memRatio;
    }

    public void setMemRatio(double memRatio) {
        this.memRatio = memRatio;
    }

    public double getDiskRatio() {
        return diskRatio;
    }

    public void setDiskRatio(double diskRatio) {
        this.diskRatio = diskRatio;
    }

    public String getIp() {
        return ipAddress.substring(0, ipAddress.indexOf(":"));
    }
}
